export interface LoginReq {
  username: string;
  password: string;
  remember?: boolean;
  captcha?: string;
  captcha_id?: string;
}

export interface LoginRes {
  uid: number;
  token: string;
  expire: number;
  refresh_token: string;
  refresh_expire: number;
}

export interface RoleInfo {
  roleName: string;
  value: string;
}

export interface GetProfileRes {
  roles: RoleInfo[];
  // 用户id
  uid: string | number;
  // 用户名
  username: string;
  // 真实名字
  nick_name: string;
  // 头像
  avatar: string;
  // 介绍
  desc?: string;
}

export interface GetCaptchaRes {
  captcha_img: string;
  captcha_id: string;
}

export interface MenuItem {
  menu_id: number;
  menu_name: string;
  route_name: string;
  menu_type: number;
  status: number;
  icon: string;
  component: string;
  permission: string;
  path: string;
  no_cache: number;
  parent_id: number;
  visible: number;
  is_frame: number;
  sort: number;
  created_at: string;
  updated_at: string;
  children?: MenuItem[];
}

export type GetMenusRes = {
  menus: MenuItem[];
  permissions: string[];
};
